package ${package.Entity};

import com.baomidou.mybatisplus.annotation.TableField;
<#if !extendBaseEntity>
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
</#if>
import com.baomidou.mybatisplus.annotation.TableName;
<#if extendBaseEntity>
import com.ozo.boot.common.database.entity.BaseEntity;
</#if>
import lombok.Getter;
import lombok.Setter;
import lombok.experimental.Accessors;

<#list importPackages as pkg>
import ${pkg};
</#list>

/**
 * ${function}
 *
 * @author ${author} ${authorEmail}
 * @version ${version}
 * @date ${date}
 */
@Getter
@Setter
@Accessors(chain = true)
@TableName("${tableName}")
<#if extendBaseEntity>
public class ${entity} extends BaseEntity {
<#else>
public class ${entity} {
</#if>

<#-- ----------  BEGIN 字段循环遍历  ---------->
<#list fieldList as field>
<#assign baseFlag = false />
<#if extendBaseEntity>
<#list baseFields as baseField>
<#if baseField == field.javaField>
<#assign baseFlag = true />
</#if>
</#list>
</#if>
    <#if !baseFlag>
    /**
     * ${field.javaFieldComment}
     */
    <#if field.columnPk>
    <#-- 主键 -->
    <#if field.columnIncrement>
    @TableId(value = "${field.columnName}", type = IdType.AUTO)
    <#else>
    @TableId(value = "${field.columnName}", type = IdType.INPUT)
    </#if>
    <#else>
    <#-- 普通字段 -->
    @TableField("${field.columnName}")
    </#if>
    private ${field.javaType} ${field.javaField};

    </#if>
</#list>
<#------------  END 字段循环遍历  ---------->
}
